package handlefunc

import (
	"fmt"
	"html/template"
	"net/http"
	"os"

	"gitee.com/kuma-blog/common"
)

// Index is . . .
func Index(w http.ResponseWriter, r *http.Request) {
	fmt.Println("主页被访问")
	t, err := template.ParseFiles(common.TemplateRoot + "index/index.html")
	if err != nil {
		fmt.Println("文件找不到", err)
		os.Exit(-1)
	}
	data := map[string]string{
		"name": "KUMA",
	}

	t.Execute(w, data)
}
